package datagraph.core

trait Bundle {

}

object Bundle {

  protected trait Callable  extends Bundle{
    //type Caller
  }


/*  trait Outputable[Out] extends Callable {
    /* trait Exec[Out]{
       def call:Out
     }
   type Caller <: Exec[Out]*/
  }*/

  trait Outputable extends Callable{
    type Out
  }
  trait NotOutputable extends Callable{
    type Out=Unit
  }


  trait Inputable extends Callable{
    type In
  }


  sealed trait RunMode

  trait JustRun extends Callable with Function0[Unit] with NotOutputable with RunMode{

  }

  trait OnlyInput[I] extends Inputable with NotOutputable with Function1[I,Unit] with RunMode{
    override type In = I
    //def exec(in: In)
  }

  trait OnlyOutput[O] extends Outputable with Function0[O] with RunMode {
    override type Out = O
  }

  trait InAndOut[I, O] extends Inputable with Outputable with Function1[I,O] with RunMode{
    override type Out = O
    override type In = I
    //def call(in: In): Out
  }


}


trait DataGraph extends Bundle {

}


trait TargetDataGraph extends DataGraph




object Cache{
  case class CacheAnyBundleLink(cur: Bundle, upstream:Seq[CacheAnyBundleLink])
  case class CacheTypeBundleLink(cur: Bundle, upstream:Seq[CacheTypeBundleLink],resultRW:ReadWriter[Any],bundleRW:ReadWriter[Bundle])

}

